public class Max {
    public static void main(String[] args) {
        System.out.println(maxNum(34, 8));
        System.out.println(maxNum(12.5, 15.7, 22.8));
    }

    public static int maxNum(int x, int y) {
        return x > y ? x : y;
    }

    public static double maxNum(double x, double y, double z) {
        double max = x;
        if (y > max) {
            max = y;
        }
        if (z > max) {
            max = z;
        }
        return max;
    }
}
